/*
 * Copyright (c) 2019-2029, ZeusOS Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author            Notes
 * 2021-03-23     longmain       first version
 */

#ifndef __ZOS_CONFIG_H__
#define __ZOS_CONFIG_H__
#include  "zos.h"

#define BOARD_USING_GPIO_DEMO
#define BOARD_USING_I2C_DEMO
#define BOARD_USING_UART_DEMO
#define BOARD_USING_SPI_LCD
#define TEST    0

struct attitude_msg_raw
{
	zos_uint8_t ahead;
    zos_uint8_t aflag;
    zos_uint8_t axl;
    zos_uint8_t axh;
    zos_uint8_t ayl;
    zos_uint8_t ayh;
    zos_uint8_t azl;
    zos_uint8_t azh;
    zos_uint8_t atl;
    zos_uint8_t ath;
    zos_uint8_t asum;
	zos_uint8_t whead;
    zos_uint8_t wflag;
    zos_uint8_t wxl;
    zos_uint8_t wxh;
    zos_uint8_t wyl;
    zos_uint8_t wyh;
    zos_uint8_t wzl;
    zos_uint8_t wzh;
    zos_uint8_t wtl;
    zos_uint8_t wth;
    zos_uint8_t wsum;
	zos_uint8_t anglehead;
    zos_uint8_t angleflag;
    zos_uint8_t rollxl;
    zos_uint8_t rollxh;
    zos_uint8_t pitchyl;
    zos_uint8_t pitchyh;
    zos_uint8_t yawzl;
    zos_uint8_t yawzh;
    zos_uint8_t angletl;
    zos_uint8_t angleth;
    zos_uint8_t anglesum;

    zos_uint8_t power;
    zos_uint8_t packetcnt;
};

struct attitude_msg_cal
{
    double ax;
    double ay;
    double az;
    double wx;
    double wy;
    double wz;
    double roll;
    double pitch;
    double yaw;
    double t;
};


#define RECV_LEN                    11
#define BTL9600                     9600
#define UARTLEN                     33

void sensor_mpu6050_task(void);
void sensor_mpu6050_iic_task(void);
void mqtt_tcp_emq_dashboard_init(void);

void send_cmd_w_init(void);//角度初始化，使Z轴角度归零
void send_cmd_a_init(void);//加速度计校准，校准加速度零偏
void send_cmd_sleep_set(void);//休眠，进入待机模式
void send_cmd_wake_set(void);//唤醒待机状态
void send_cmd_vertical_set(void);//垂直安装，模块垂直放置
void send_cmd_level_set(void);//水平安装，模块水平放置


#endif //__ZOS_CONFIG_H__
